<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NumCpp: Iteration.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NumCppLogoDoxygen.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">NumCpp
   &#160;<span id="projectnumber">2.4.0</span>
   </div>
   <div id="projectbrief">A Templatized Header Only C++ Implementation of the Python NumPy Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_iteration_8hpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Iteration.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_iteration_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_error_8hpp.html">NumCpp/Core/Internal/Error.hpp</a>&quot;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_types_8hpp.html">NumCpp/Core/Types.hpp</a>&quot;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacenc.html">nc</a></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;{</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keyword">namespace </span>roots</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    {</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <span class="comment">//================================================================================</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="comment">// Class Description:</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classnc_1_1roots_1_1_iteration.html">   46</a></span>&#160;<span class="comment"></span>        <span class="keyword">class </span><a class="code" href="classnc_1_1roots_1_1_iteration.html">Iteration</a> </div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        {</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;            <span class="comment">//============================================================================</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;            <span class="comment">// Method Description:</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classnc_1_1roots_1_1_iteration.html#a2d7285a81c033d56ce8283b6dbfca136">   55</a></span>&#160;<span class="comment"></span>            <span class="keyword">explicit</span> <a class="code" href="classnc_1_1roots_1_1_iteration.html#a2d7285a81c033d56ce8283b6dbfca136">Iteration</a>(<span class="keywordtype">double</span> epsilon) noexcept : </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;                <a class="code" href="classnc_1_1roots_1_1_iteration.html#a5eafe219bb90f82da4ece84f012a411a">epsilon_</a>(epsilon)</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;            {}</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;            <span class="comment">//============================================================================</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;            <span class="comment">// Method Description:</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classnc_1_1roots_1_1_iteration.html#a7948f08cfaa01f5685ec35149bf6bba0">   66</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1roots_1_1_iteration.html#a7948f08cfaa01f5685ec35149bf6bba0">Iteration</a>(<span class="keywordtype">double</span> epsilon, <a class="code" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> maxNumIterations) noexcept : </div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                <a class="code" href="classnc_1_1roots_1_1_iteration.html#a5eafe219bb90f82da4ece84f012a411a">epsilon_</a>(epsilon),</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                <a class="code" href="classnc_1_1roots_1_1_iteration.html#a9b1c4ea8cf91c5308020c105293b4a02">maxNumIterations_</a>(maxNumIterations)</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;            {}</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            <span class="comment">//============================================================================</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            <span class="comment">// Method Description:</span></div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="comment"></span>            <span class="keyword">virtual</span> <a class="code" href="classnc_1_1roots_1_1_iteration.html#a44492e4a1849938cd7017154213ec002">~Iteration</a>() noexcept = default;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            <span class="comment">//============================================================================</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            <span class="comment">// Method Description:</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="classnc_1_1roots_1_1_iteration.html#ab3192d0f9de4b8b27b23013c65489e5a">   83</a></span>&#160;<span class="comment"></span>            <a class="code" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> <a class="code" href="classnc_1_1roots_1_1_iteration.html#ab3192d0f9de4b8b27b23013c65489e5a">numIterations</a>() const noexcept </div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;            { </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1roots_1_1_iteration.html#a84d7f2f7412d1f54861edeacc7bc0c20">numIterations_</a>;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;            }</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160; </div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;            <span class="comment">//============================================================================</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;            <span class="comment">// Method Description:</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classnc_1_1roots_1_1_iteration.html#a85e79a4794bc3a6ac6bc3564956737a2">   93</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">void</span> <a class="code" href="classnc_1_1roots_1_1_iteration.html#a85e79a4794bc3a6ac6bc3564956737a2">resetNumberOfIterations</a>() noexcept </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;            { </div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                <a class="code" href="classnc_1_1roots_1_1_iteration.html#a84d7f2f7412d1f54861edeacc7bc0c20">numIterations_</a> = 0;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;            }</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;            <span class="comment">//============================================================================</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            <span class="comment">// Method Description:</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="classnc_1_1roots_1_1_iteration.html#ad0262a1a694e734ebc154c77f010bcff">  104</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">void</span> <a class="code" href="classnc_1_1roots_1_1_iteration.html#ad0262a1a694e734ebc154c77f010bcff">incrementNumberOfIterations</a>()</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;            { </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                ++<a class="code" href="classnc_1_1roots_1_1_iteration.html#a84d7f2f7412d1f54861edeacc7bc0c20">numIterations_</a>;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="classnc_1_1roots_1_1_iteration.html#a84d7f2f7412d1f54861edeacc7bc0c20">numIterations_</a> &gt; <a class="code" href="classnc_1_1roots_1_1_iteration.html#a9b1c4ea8cf91c5308020c105293b4a02">maxNumIterations_</a>)</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                {</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                    <a class="code" href="_error_8hpp.html#a0f0ce4acf1fd6032112a06ebc50bb05a">THROW_RUNTIME_ERROR</a>(<span class="stringliteral">&quot;Maximum number of iterations has been reached; no root has been found within epsilon.&quot;</span>);</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;                }</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            }</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160; </div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;            <span class="comment">//====================================Attributes==============================</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classnc_1_1roots_1_1_iteration.html#a5eafe219bb90f82da4ece84f012a411a">  114</a></span>&#160;            <span class="keyword">const</span> <span class="keywordtype">double</span>    <a class="code" href="classnc_1_1roots_1_1_iteration.html#a5eafe219bb90f82da4ece84f012a411a">epsilon_</a>;</div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="classnc_1_1roots_1_1_iteration.html#a9b1c4ea8cf91c5308020c105293b4a02">  115</a></span>&#160;            <a class="code" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a>          <a class="code" href="classnc_1_1roots_1_1_iteration.html#a9b1c4ea8cf91c5308020c105293b4a02">maxNumIterations_</a>{1000};</div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="classnc_1_1roots_1_1_iteration.html#a84d7f2f7412d1f54861edeacc7bc0c20">  116</a></span>&#160;            <a class="code" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a>          <a class="code" href="classnc_1_1roots_1_1_iteration.html#a84d7f2f7412d1f54861edeacc7bc0c20">numIterations_</a>{0};</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        };</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    }  <span class="comment">// namespace roots</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;} <span class="comment">// namespace nc</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aclassnc_1_1roots_1_1_iteration_html_a7948f08cfaa01f5685ec35149bf6bba0"><div class="ttname"><a href="classnc_1_1roots_1_1_iteration.html#a7948f08cfaa01f5685ec35149bf6bba0">nc::roots::Iteration::Iteration</a></div><div class="ttdeci">Iteration(double epsilon, uint32 maxNumIterations) noexcept</div><div class="ttdef"><b>Definition:</b> Iteration.hpp:66</div></div>
<div class="ttc" id="aclassnc_1_1roots_1_1_iteration_html_a2d7285a81c033d56ce8283b6dbfca136"><div class="ttname"><a href="classnc_1_1roots_1_1_iteration.html#a2d7285a81c033d56ce8283b6dbfca136">nc::roots::Iteration::Iteration</a></div><div class="ttdeci">Iteration(double epsilon) noexcept</div><div class="ttdef"><b>Definition:</b> Iteration.hpp:55</div></div>
<div class="ttc" id="a_error_8hpp_html"><div class="ttname"><a href="_error_8hpp.html">Error.hpp</a></div></div>
<div class="ttc" id="aclassnc_1_1roots_1_1_iteration_html"><div class="ttname"><a href="classnc_1_1roots_1_1_iteration.html">nc::roots::Iteration</a></div><div class="ttdoc">ABC for iteration classes to derive from.</div><div class="ttdef"><b>Definition:</b> Iteration.hpp:46</div></div>
<div class="ttc" id="aclassnc_1_1roots_1_1_iteration_html_ad0262a1a694e734ebc154c77f010bcff"><div class="ttname"><a href="classnc_1_1roots_1_1_iteration.html#ad0262a1a694e734ebc154c77f010bcff">nc::roots::Iteration::incrementNumberOfIterations</a></div><div class="ttdeci">void incrementNumberOfIterations()</div><div class="ttdef"><b>Definition:</b> Iteration.hpp:104</div></div>
<div class="ttc" id="anamespacenc_html_af0f49663fb63332596e2e6327009d581"><div class="ttname"><a href="namespacenc.html#af0f49663fb63332596e2e6327009d581">nc::uint32</a></div><div class="ttdeci">std::uint32_t uint32</div><div class="ttdef"><b>Definition:</b> Types.hpp:40</div></div>
<div class="ttc" id="aclassnc_1_1roots_1_1_iteration_html_a9b1c4ea8cf91c5308020c105293b4a02"><div class="ttname"><a href="classnc_1_1roots_1_1_iteration.html#a9b1c4ea8cf91c5308020c105293b4a02">nc::roots::Iteration::maxNumIterations_</a></div><div class="ttdeci">uint32 maxNumIterations_</div><div class="ttdef"><b>Definition:</b> Iteration.hpp:115</div></div>
<div class="ttc" id="aclassnc_1_1roots_1_1_iteration_html_a5eafe219bb90f82da4ece84f012a411a"><div class="ttname"><a href="classnc_1_1roots_1_1_iteration.html#a5eafe219bb90f82da4ece84f012a411a">nc::roots::Iteration::epsilon_</a></div><div class="ttdeci">const double epsilon_</div><div class="ttdef"><b>Definition:</b> Iteration.hpp:114</div></div>
<div class="ttc" id="aclassnc_1_1roots_1_1_iteration_html_a84d7f2f7412d1f54861edeacc7bc0c20"><div class="ttname"><a href="classnc_1_1roots_1_1_iteration.html#a84d7f2f7412d1f54861edeacc7bc0c20">nc::roots::Iteration::numIterations_</a></div><div class="ttdeci">uint32 numIterations_</div><div class="ttdef"><b>Definition:</b> Iteration.hpp:116</div></div>
<div class="ttc" id="aclassnc_1_1roots_1_1_iteration_html_a85e79a4794bc3a6ac6bc3564956737a2"><div class="ttname"><a href="classnc_1_1roots_1_1_iteration.html#a85e79a4794bc3a6ac6bc3564956737a2">nc::roots::Iteration::resetNumberOfIterations</a></div><div class="ttdeci">void resetNumberOfIterations() noexcept</div><div class="ttdef"><b>Definition:</b> Iteration.hpp:93</div></div>
<div class="ttc" id="a_error_8hpp_html_a0f0ce4acf1fd6032112a06ebc50bb05a"><div class="ttname"><a href="_error_8hpp.html#a0f0ce4acf1fd6032112a06ebc50bb05a">THROW_RUNTIME_ERROR</a></div><div class="ttdeci">#define THROW_RUNTIME_ERROR(msg)</div><div class="ttdef"><b>Definition:</b> Error.hpp:37</div></div>
<div class="ttc" id="anamespacenc_html"><div class="ttname"><a href="namespacenc.html">nc</a></div><div class="ttdef"><b>Definition:</b> Coordinate.hpp:44</div></div>
<div class="ttc" id="aclassnc_1_1roots_1_1_iteration_html_ab3192d0f9de4b8b27b23013c65489e5a"><div class="ttname"><a href="classnc_1_1roots_1_1_iteration.html#ab3192d0f9de4b8b27b23013c65489e5a">nc::roots::Iteration::numIterations</a></div><div class="ttdeci">uint32 numIterations() const noexcept</div><div class="ttdef"><b>Definition:</b> Iteration.hpp:83</div></div>
<div class="ttc" id="a_types_8hpp_html"><div class="ttname"><a href="_types_8hpp.html">Types.hpp</a></div></div>
<div class="ttc" id="aclassnc_1_1roots_1_1_iteration_html_a44492e4a1849938cd7017154213ec002"><div class="ttname"><a href="classnc_1_1roots_1_1_iteration.html#a44492e4a1849938cd7017154213ec002">nc::roots::Iteration::~Iteration</a></div><div class="ttdeci">virtual ~Iteration() noexcept=default</div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_34171bd951b13a53aa9f237277a18e40.html">NumCpp</a></li><li class="navelem"><a class="el" href="dir_22368e90b3593b912515c50bf54c969c.html">Roots</a></li><li class="navelem"><a class="el" href="_iteration_8hpp.html">Iteration.hpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
